/**
 * Created by liubin on 2014/12/11.
 */
define(['app', 'notification'], function (app) {
     return app.factory('AlertService', function () {
          var alert = function(title, content, buttons, inputType, placeholder, options, callback) {
               $.SmartMessageBox({
                    title: title,
                    content: content,
                    buttons: buttons,
                    input: inputType,
                    placeholder: placeholder,
                    options: options
               }, function (ButtonPressed) {
                    if (callback) {
                         callback(ButtonPressed);
                    }
               });
            //$.SmartMessageBox({
            //    title: "Smart Notification: Buttons",
            //    content: "Lots of buttons to go...",
            //    buttons: '[Need?][You][Do][Buttons][Many][How]'
            //});
          }
          return {
               confirm: function(title, content, callback){
                    alert(title, content, '[取消][确定]', null, null, null, function(ButtonPressed){
                         if(ButtonPressed == '确定'){
                              if(callback){
                                   callback();
                              }
                         }
                    });
               }
          }
     });
});